package com.kang.controller;

import com.kang.bean.UserRole;
import com.kang.commons.Result;
import com.kang.service.UserRoleService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: service
 * @description:
 * @author: K.faWu
 * @create: 2022-03-04 14:35
 **/
@RestController
@RequestMapping("/userRole")
public class UserRoleController {
    private final UserRoleService userRoleService;

    public UserRoleController(UserRoleService userRoleService) {
        this.userRoleService = userRoleService;
    }

    @PostMapping
    public Result<?> save(@RequestBody UserRole userRole){
        userRoleService.addOrUpdate(userRole);
        return Result.success();
    }
}
